<template>
	<view class="container">
		<view class="banner" @click="navToUrl('/pages/user/newuser')"><img src="@/static/images/ui-14/1.png"></img></view>
		<view class="wal_det">
			<view class="det_list">
				<view class="det_item" v-for="(item, index) in funcList" :key="index" @click="navToUrl(item.url)">
					<view class="det_tit">{{ item.name }}</view>
					<view class="det_see">操作详情</view>
					<!-- <view class="cuIcon-right" @click="walletChange"></view> -->
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import tabBar from '@/components/tabBar/tabBar.vue'
	export default {
		components: {
			tabBar
		},
		data() {
			return {
				user_bg: '',
				avatar: '/static/icon_avatar.png',
				userinfo: [],
				list: [],
				ifOnShow: false,
				unit: '',
				funcList:[{
					name: '绑定银行卡流程',
					url: '/pages/help/detail?id=29'
				}, {
					name: '添加收货地址流程',
					url: '/pages/help/detail?id=30'
				}, {
					name: '产品签约流程',
					url: '/pages/help/detail?id=32'
				}, {
					name: '小组收益规则',
					url: '/pages/help/detail?id=22'
				}, {
					name: '用户收益规则',
					url: '/pages/help/detail?id=37'
				}, {
					name: '提现流程',
					url: '/pages/help/detail?id=34'
				}, {
					name: '充值流程',
					url: '/pages/help/detail?id=35'
				}, {
					name: '实名认证流程',
					url: '/pages/help/detail?id=36'
				}],
			};
		},
		onHide() {
			this.ifOnShow = true
		},
		onShow() {
			if (this.ifOnShow) {
				this.getData();
			}
			let pages = getCurrentPages();
			let currPage = pages[pages.length-1];
			if (currPage.$vm.bank_id){
				this.bank_id = currPage.$vm.bank_id;
				// this.loadData();
			}
		},
		onLoad: function(option) {
			// this.getData();
		},
		
		methods: {
			//user数据
			getData: function() {
				//获取基础参数
				// uni.showLoading({
				// 	title: "数据加载中",
				// 	mask: true
				// })
				var info = uni.getStorageSync("userinfo");
				if (info.token) {
					let timestamp = this.helper.now();
					let sign = this.helper.setSign(['username=' + info.username, 'token=' + info.token, 'timestamp=' +
						timestamp
					]);
					this.helper.req({
						api: "getUserInfo",
						timestamp: timestamp,
						data: {
							username: info.username,
							token: info.token
						},
						header: {
							sign: sign
						},
						method: 'GET',
					}).then(res => {
						// console.log('userInfo参数:', this.userinfo)
						
					})
				} else {
					// uni.hideLoading();
				}
			},
			navToUrl: function(url) {
				console.log('url:',url)
				return uni.navigateTo({
					url: url
				});
			},
			imageError: function(e) {
				this.avatar = '/static/icon_avatar.png';
			},
			funcChange(index){
				console.log(index)
				this.navToUrl(this.funcList[index].url)
			}
		},
	};
</script>

<style lang="scss">
	page {
		background: #dde9fd;
	}
	
	.banner{
		width: 100vw;
		padding-top: 40rpx;
		img{
			width: 100%;
		}
	}
	
	.wal_det{
		position: relative;
		width: 92vw;
		min-height: 144vw;
		margin: 4vw;
		.det_list{
			width: 100%;
			height: 100%;
			position: absolute;
			top: 0;
			left: 0;
			z-index: 2;
			
			.det_item{
				height: 16vw;
				color: #5b5e63;
				font-size: 16px;
				display: flex;
				margin: 0 4vw;
				border-bottom: 0.5px solid #5b5e63;
				
				.det_tit{
					width: 70vw;
					line-height: 16vw;
					font-size: 15px;
				}
				.det_see{
					width: 18vw;
					line-height: 16vw;
					font-size: 14px;
					text-align: right;
				}
				.cuIcon-right{
					line-height: 16vw;
				}
			}
			.det_item:last-child{
				border: none;
			}
		}
	}
	
	.btn_list{
		width: 100vw;
		.btn{
			width: 70vw;
			height: 12vw;
			line-height: 12vw;
			text-align: center;
			color:#fff;
			font-size: 18px;
			border-radius: 6vw;
			border:1px solid #5992D7;
			margin: 8vw 15vw; 
			font-weight: bold;
		}
		.draw{
			color:#5992D7;
			background: #f9f9f9;
		}
		.recharge{
			background: linear-gradient( 180deg, #50A7FF 0%, #3267FF 100%);
		}
	}
</style>
<!-- uni-grid -->
<style lang="scss" scoped>
	.image {
		width: 25px;
		height: 25px;
	}

	.text {
		margin-top: 10upx;
	}

	.example-body {
		/* #ifndef APP-NVUE */
		// display: block;
		/* #endif */
	}

	.swiper {
		height: 420px;
	}

	/* #ifdef H5 */
	@media screen and (min-width: 768px) and (max-width: 1425px) {
		.swiper {
			height: 630px;
		}
	}

	@media screen and (min-width: 1425px) {
		.swiper {
			height: 830px;
		}
	}

	/* #endif */
</style>